package com.mall.shopping.converter;


import com.mall.shopping.dal.entitys.Item;
import com.mall.shopping.dto.ProductDetailDto;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

/**
 * Created by fenglin on 2020/9/16 8:09 PM
 */
@Mapper(componentModel = "spring")
public interface ProductDetailConverter {
    @Mappings({
            @Mapping(source = "id",target = "productId"),
            @Mapping(source = "title",target = "productName"),
            @Mapping(source = "sellPoint",target = "subTitle"),
            @Mapping(source = "price",target = "salePrice"),
            @Mapping(source = "limitNum",target = "limitNum"),
            @Mapping(source = "image",target = "productImageBig"),
            @Mapping(source = "image",target = "productImageSmall"),
            @Mapping(source = "image",target = "detail")
    })
    ProductDetailDto item2PDDto(Item item);

}
//Consider to declare/implement a mapping method: "java.lang.String[] map(java.lang.String value)".